
<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
        <meta name="description" content="">
        <meta name="author" content="">

        <title>后台</title>

        <link href="__PUBLIC__/images/favicon.ico" rel="shortcut icon" />

        <!-- Bootstrap core CSS -->
        <link rel="stylesheet" href="__PUBLIC__/css/bootstrap.min.css" />
        <link rel="stylesheet" href="__PUBLIC__/css/bootstrap-theme.min.css" />
        <link rel="stylesheet" href="__PUBLIC__/css/dashboard.css" />
        <link rel="stylesheet" href="__PUBLIC__/css/bootstrap-switch.css" />
        <link rel="stylesheet" href="__PUBLIC__/css/icheck/all.css" />
        <link rel="stylesheet" href="__PUBLIC__/css/select2/select2.css" />
        <link href="__PUBLIC__/css/select2/select2-bootstrap.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="__PUBLIC__/css/bootstrap-datetimepicker.css" />
    </head>

    <body>

    <include file="Common/topNav" />

    <div class="container-fluid">
        <div class="row">
            <include file="Common/leftMenu" />
            <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
                <div class="cont-title clearfix">
                    <div class="title">订单列表</div>
					<div class="btn-group"><button type="button" id="output"  class="btn">导出</button></div>
                    <!--<div class="btn-group"><button type="button" id="addNews"  class="btn">添加</button></div>-->
                </div>
                <form class="jc-search form-inline searchForm" action="{:U('Admin/Order/orderList')}" method="post">
                    <div class="form-group">
                        <label>订单号:</label>
                        <input type="text" class="form-control" name="order_sn" value="{$order_sn}" placeholder="输入订单号">
                    </div>
					<div class="form-group">
                        <label>时间:</label>
                        <input type="text" class="form-control datetimepicker" name="start_time" value="{$start_time}" placeholder="开始时间">-
						<input type="text" class="form-control datetimepicker" name="end_time" value="{$end_time}" placeholder="结束时间">
                    </div>
                   <div class="form-group">
                        <label>状态:</label>
                        <select name='status' class="form-control">
							<option value=''>全部</option>
							<option <if condition="$status eq 2"> selected="selected"</if> value='2'>已付款</option>
							<option <if condition="$status eq 1"> selected="selected"</if> value='1'>待付款</option>
						</select>
                    </div>
                    
                    <input class="btn" type="submit" value="搜索" />
                </form>
                <div class="table-responsive">
                    <table class="table table-striped table-hover" id="tableData">
                        <thead>
                            <tr>
                                <th>序号</th>
                                <th>单号</th>
                                <th>商品名称</th>
                                <th>价格</th>
                                <th>支付方式</th>
                                <th>备注</th>
                                <th>时间</th>
                                <th>状态</th>
								<th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                        <volist name="data['data']" id="order">
                            <tr>
                                <td>{$i}</td>
                                <td>{$order.order_sn}</td>
                                <td>{$order.goods_name}</td>
                                <td>{$order.price}元</td>
                                <td>
                            <if condition="$order['pay_type'] eq 1" >线下支付</if>
                            <if condition="$order['pay_type'] eq 2" >微信支付</if>
                            <if condition="$order['pay_type'] eq 3" >畅由积分</if>       
                                </td>
                                <td>{$order.remark}</td>
                                <td>{$order.ctime|date='Y-m-d H:i:s',###}</td>
                                <td>
                                    <if condition="$order['status'] eq 1" >待付款</if>
                            <if condition="$order['status'] eq 2" >已付款</if>
							<if condition="$order['status'] eq 100" >积分退款</if>
							<if condition="$order['status'] eq 200" >后台确认收货</if>
                                </td>
                                <td>
								<if condition="$order['pay_type'] eq 3 && $order['status'] eq 2">
								<a href="{:U('Admin/Order/refundOrder',array('order_id'=>$order['id']))}">退款</a> | 
								<a href="{:U('Admin/Order/orderConfirm',array('order_id'=>$order['id']))}">确认收货</a>
								</if>
								</td>
                            </tr>
                        </volist>    
                        </tbody>
                    </table>
                    <div class="page">
                    	{$data.page}
                    </div>
                </div>
            </div>
        </div>
    </div>
    <include file="Common/modalHtmls" />
    <script type="text/javascript" src="__PUBLIC__/js/jquery.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/bootstrap-switch.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/icheck.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/validator.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.all.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/select2/select2.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/select2tree.js"></script>
	<script type="text/javascript" src="__PUBLIC__/js/bootstrap-datetimepicker.js"></script>
    <script>
	
	$('.datetimepicker').datetimepicker({
            format: 'yyyy-mm-dd',
            language: 'ch',
            pickDate: true,
            pickTime: false,
            autoclose:true,
            minView:2,
            //pickerPosition:"bottom-left"
        });
       $("#output").click(function(){
	   common.redirect("{:U('Admin/Order/output')}?"+$(".searchForm").serialize());
	   })
    </script>
</body>
</html>
